package com.galaxy.product.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.product.domain.ProductUnit;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 商品单位业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ProductUnit.class)
public class ProductUnitBo extends BaseEntity {
    /** 主键 */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;
    /** 单位名称 */
    @NotBlank(message = "单位名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 50, message = "单位名称长度不能超过50个字符")
    private String name;
    /** 单位符号 */
    @NotBlank(message = "单位符号不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 20, message = "单位符号长度不能超过20个字符")
    private String symbol;
    /** 单位类型(1:容量,2:重量,3:长度,4:其他) */
    @NotNull(message = "单位类型不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer unitType;
    /** 单位描述 */
    @Size(max = 200, message = "单位描述长度不能超过200个字符")
    private String description;
    /** 排序 */
    private Integer sort;
    /** 状态(0:禁用,1:正常) */
    @NotNull(message = "状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer status;
    /** 租户ID */
    private String tenantId;
} 